Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set boolean config values correctly #2440

Merged
merged 1 commit into from
Jan 14, 2017
Merged

Set boolean config values correctly #2440

merged 1 commit into from
Jan 14, 2017

Conversation

iredchuk
Copy link
Contributor

yarn config set [option] [false|true]
should set the option value to false/true respectively.
Currently it's set to string value "false"/"true".

Test Plan

  • yarn config set strict-ssl false
  • $HOME/.yarnrc should contain the line:
    strict-ssl false


const [key, val = true] = args;
const key = args[0];
const val = BaseRegistry.normalizeConfigOption(args[1] || true);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it better to use yarnConfig without importing BaseRegistry?

Copy link
Contributor Author

@iredchuk iredchuk Jan 13, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, can't use it directly - it's static in BaseRegistry, or do you mean something else?

Copy link
Contributor Author

@iredchuk iredchuk Jan 13, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But maybe it's better to ensure config is normalized in yarn-registry's saveHomeConfig from the dependency prospective and also to make it more resilient?
Please check the update.

@OACDesigns
Copy link

OACDesigns commented Mar 28, 2017

this PR appears to have introduced a regression (#2856).
Setting a value to an empty string now results in defaulting to a boolean true
Specifically yarn config set version-tag-prefix "" now fails to work.

arcanis pushed a commit that referenced this pull request Apr 18, 2017
* Fixes regression introduced in PR #2440
* Related to #2434
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants